package com.study.system.course.controller;

import com.edu.common.entity.Course;
import com.study.system.course.service.CourseService;
import jakarta.annotation.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CourseController {

    @Resource
    private CourseService courseService;

    @RequestMapping("/courses")
    public ResponseEntity<List<Course>> getAllCourse(){
        List<Course> courses = courseService.getAllCourses();
        return ResponseEntity.ok(courses);
    }
}
